﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Pages/Principal.master" AutoEventWireup="true" CodeFile="SaldoAlmacen.aspx.cs" Inherits="Pages_SaldoAlmacen" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <div class="GridviewDiv">
        <center>
            <asp:Label ID="lblCodigo" runat="server" Text="" Visible="false"></asp:Label>
            <asp:Label ID="lblNombre" runat="server" Text="" Font-Size="Small" Font-Bold="true"></asp:Label>
            <p></p>
            <asp:GridView ID="GridView1" runat="server"
                AutoGenerateColumns="False" CssClass="Gridview" 
                DataSourceID="ObjectDataSource1" ShowFooter="True" 
                EmptyDataText="No hay saldo del producto en ningún almacén"
                DataKeyNames="Articulo,CodAlm" onrowcreated="GridView1_RowCreated">
                <AlternatingRowStyle BackColor="#f0f2da" />
                <FooterStyle BackColor="#f0f2da" ForeColor="#FF6600"/>
                <Columns>
                    <asp:BoundField DataField="Articulo" HeaderText="Articulo" SortExpression="Articulo" Visible="false" />
                    <asp:BoundField DataField="Cia" HeaderText="Cia" SortExpression="Cia" />
                    <asp:BoundField DataField="CodAlm" HeaderText="Codigo Almacen" SortExpression="CodAlm" Visible="false"/>
                    <asp:HyperLinkField DataNavigateUrlFields="Articulo,CodAlm,Cia,Cierre,Nombre" 
                        DataNavigateUrlFormatString="~/Pages/MovimientoAlmacen.aspx?Articulo={0}&amp;CodAlm={1}&amp;Cia={2}&amp;Periodo={3}&amp;NombreAlm={4}"
                            DataTextField="Nombre" HeaderText="Almacen" SortExpression="Nombre" />
                    <asp:BoundField DataField="Cierre" DataFormatString="{0:d}" HtmlEncode="False" HeaderText="Cierre" ItemStyle-HorizontalAlign="Center" SortExpression="Cierre" />
                    <asp:BoundField DataField="SaldoInicial" HeaderText="S. Inicial" DataFormatString="{0:n0}" HtmlEncode="False" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" SortExpression="SaldoInicial" />
                    <asp:BoundField DataField="Entradas" HeaderText="Entradas" DataFormatString="{0:n0}" HtmlEncode="False" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" SortExpression="SaldoInicial" />
                    <asp:BoundField DataField="Salidas" HeaderText="Salidas" DataFormatString="{0:n0}" HtmlEncode="False" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" SortExpression="Salidas" />
                    <asp:BoundField DataField="SaldoActual" HeaderText="S Actual" DataFormatString="{0:n0}" HtmlEncode="False" ItemStyle-HorizontalAlign="Right" ItemStyle-Width="100px" SortExpression="SaldoActual" />
                </Columns>
            </asp:GridView>
        </center>
        <asp:ObjectDataSource ID="ObjectDataSource1" 
                          runat="server" 
                          SelectMethod="leerSaldosAlmacen" 
                          TypeName="Consulta.Manager.MInventario" 
                          SortParameterName="pClausulaOrderBy">
            <SelectParameters>
                <asp:ControlParameter ControlID="lblCodigo" Name="pCodigo" PropertyName="Text" Type="String" DefaultValue="" />
                <asp:Parameter Name="pClausulaOrderBy" Type="String" DefaultValue="" />
            </SelectParameters>
        </asp:ObjectDataSource>
    </div>
</asp:Content>